import { http } from '@/api';
import { PORT1 } from '@/api/config/port';
import { ResultData } from '@/api/interface/index';
import { DeviceCreate, DeviceSearch } from '../interface/deviceManager';

// 创建
export const Create = (params: Partial<DeviceCreate>) => {
  return http.post<ResultData>(PORT1 + `/admin/device/create`, params);
};

// 查询列表
export const Search = (params: DeviceSearch) => {
  return http.post<any>(PORT1 + `/admin/device/search`, params);
};

// 删除列表
export const Delete = (id: string | number) => {
  return http.get<any>(
    PORT1 + `/admin/device/delete`,
    { id: id },
    { loading: true }
  );
};
